package com.winenine999.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.winenine999.custom.dao.CSyroleauthorityMapper;
import com.winenine999.generator.dao.SyroleauthorityMapper;
import com.winenine999.model.Syroleauthority;
import com.winenine999.service.ISyroleauthorityService;
@Service
public class SyroleauthorityService implements ISyroleauthorityService {
	@Autowired
	private SyroleauthorityMapper syroleauthorityMapper;
	@Autowired
	private CSyroleauthorityMapper cSyroleauthorityMapper;
	/**
	 * 根据id删除syroleauthority
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return syroleauthorityMapper.deleteByPrimaryKey(id);
	}
	/**
	 * 选择字段插入syroleauthority
	 */
	@Override
	public int insertSelective(Syroleauthority syroleauthority) {
		
		return syroleauthorityMapper.insertSelective(syroleauthority);
	}
	/**
	 * 根据id查询syroleauthority
	 */
	@Override
	public Syroleauthority selectByPrimaryKey(Integer id) {
		
		return syroleauthorityMapper.selectByPrimaryKey(id);
	}
	/**
	 * 选择字段修改syroleauthority
	 */
	@Override
	public int updateByPrimaryKeySelective(Syroleauthority syroleauthority) {
		
		return syroleauthorityMapper.updateByPrimaryKeySelective(syroleauthority);
	}
//----------------------------custom------------------------------------------
	/**
	 * 删除该角色的所有权限
	 */
	@Override
	public int deleteRolePermissionsByRoleId(Integer roleid) {
		
		return cSyroleauthorityMapper.deleteRolePermissionsByRoleId(roleid);
	}
}
